package com.gdteam.kernel.event.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.tapestry5.ioc.annotations.EagerLoad;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.gdteam.kernel.event.Context;
import com.gdteam.kernel.main.ServiceManager;

@EagerLoad
public class DefaultContext implements Context {
    
    private Map<String, Object> map = new HashMap<String, Object>();
    
    @Inject
    public DefaultContext(ServiceManager mgr) {
        this.map.put(ServiceManager.FQN, mgr);
    }
    
    public Object get(String key) {
        return this.map.get(key); 
    }
    
    public void put(String key, Object value) {
        if (null == key || null == value) return;
        this.map.put(key, value);
    }

}
